#include <gtest/gtest.h>
#include <Code3.h>

struct Test3 : ::testing::Test
{
    virtual void SetUp() override
    {
		for(int i = 0; i < 3; ++i)
		{
			otherList[i] = 0;
		}
    }

    virtual void TearDown() override
    {
		for(int i = 0; i < 3; ++i)
		{
			ASSERT_TRUE(otherList[i] == 0);
		}
    }

    CfgList target;
private:
    int otherList[3];
};

TEST_F(Test3, should_updateList_twice_succ)
{
    int cfg[] = {1,2,3};
    target.updateList(cfg);
    ASSERT_EQ(target.list[0], 1);
    ASSERT_EQ(target.list[1], 2);
    ASSERT_EQ(target.list[2], 3);

    target.updateList(cfg);
    ASSERT_EQ(target.list[0], 1);
    ASSERT_EQ(target.list[1], 2);
    ASSERT_EQ(target.list[2], 3);
}

